package ltd.hltk.likedo;


import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.stream.Stream;

public class RenameFiles {




    public static void main(String[] args) {
        Path path=Paths.get("d:","aran","tmp");

        String dir=String.valueOf(path);

        File p=new File(dir);
        File[] files=p.listFiles();
        if (p.exists()&&p.isDirectory()) {
            assert files != null;
            Stream.of(files).forEach(f->{
                String nm= dir +"/"+f.getName().replace("Service","Handler");
                File ds=new File(nm);
                f.renameTo(ds);
                System.out.println(ds.getName());
            });
        }

    }

}
